//
//  ZDWTBViewController.m
//  W2MD
//
//  Created by zhudongwei on 14-9-28.
//  Copyright (c) 2014年 zhudongwei. All rights reserved.
//

#import "ZDWTBViewController.h"

@interface UIImage(Overlay)
@end

@implementation UIImage(Overlay)

//- (UIImage *)imageWithColor:(UIColor *)color1
//{
//    UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);
//    CGContextRef context = UIGraphicsGetCurrentContext();
//    CGContextTranslateCTM(context, 0, self.size.height);
//    CGContextScaleCTM(context, 1.0, -1.0);
//    CGContextSetBlendMode(context, kCGBlendModeNormal);
//    CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
//    CGContextClipToMask(context, rect, self.CGImage);
//    [color1 setFill];
//    CGContextFillRect(context, rect);
//    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
//    UIGraphicsEndImageContext();
//    return newImage;
//}
@end

@interface ZDWTBViewController ()

@end

@implementation ZDWTBViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //self.tabBar.hidden = YES;
    // Do any additional setup after loading the view.
    UIColor *purpleColorV = [UIColor colorWithRed:158.f/255.0f green:98/255.0f blue:209/255.0f alpha:1.0f];
    [self.tabBar setTintColor:purpleColorV];
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: purpleColorV, NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
    
    
    UIColor * unselectedColor = [UIColor lightGrayColor];//[UIColor colorWithRed:229.f/255.0f green:229.f/255.0f blue:229.f/255.0f alpha:1.0f];
    
    // set color of unselected text
    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:unselectedColor, NSForegroundColorAttributeName, nil]
                                             forState:UIControlStateNormal];
    
    // generate a tinted unselected image based on image passed via the storyboard
    for(UITabBarItem *item in self.tabBar.items) {
        // use the UIImage category code for the imageWithColor: method
        //item.image = [[item.selectedImage imageWithColor:unselectedColor] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
